<% layout('/layouts/default.html', {title: '任务待办', libs: ['layout', 'dataGrid']}){ %>
<div class="main-content">
    <div class="box box-main">
        <div class="box-header">
            <div class="box-tools pull-left" style="position: relative">
                <ul class="nav nav-tabs bangPing-tabs">
                    <li><a href="${ctx}/action/dcSupTaskAction/noCompleteView">${text('待办')}</a></li>
                    <li class="active"><a href="${ctx}/action/dcSupTaskAction/completeListView">${text('已办')}</a></li>
                </ul>
            </div>
            <#form:form id="searchForm" model="${dcSupTaskAction}" action="${ctx}/action/dcSupTaskAction/completeListData" method="post" class="form-inline"
            data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
            <div style="float: right">
                <div class="form-group">
                    <label class="control-label">${text('任务年度')}：</label>
                    <div class="control-inline width-120">
                        <#form:select path="dcSupTaskInfo.taskYear" items="${yearList}" blankOption="true" data-placeholder="请选择" itemLabel="yearLabel" itemValue="yearValue" class="form-control width-120" defaultValue="${currentYear}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">${text('任务标题')}：</label>
                    <div class="control-inline width-160">
                        <#form:input path="dcSupTaskInfo.taskTitle" maxlength="200" class="form-control width-160" placeholder="请输入任务标题"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">${text('任务类型')}：</label>
                    <div class="control-inline width-160">
                        <#form:select path="dcSupTaskInfo.taskTypeCode" items="${dicts}" blankOption="true" data-placeholder="请选择" itemLabel="dictLabel" itemValue="dictValue" class="form-control width-160"/>
                    </div>
                </div>
                <div class="form-group">
                    <button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
                    <button onclick="cz();" class="btn btn-default btn-sm">${text('重置')}</button>
                </div>
            </div>
        </#form:form>
    </div>
    <div class="box-body">
        <table id="dataGrid"></table>
        <div id="dataGridPage"></div>
    </div>
</div>
</div>
<% } %>
<script>
    //重置
    function cz(){
        searchForm.reset();
        $('#dataGrid').dataGrid('reloadGrid');
    }

    $('#dataGrid').dataGrid({
        dataGridPage: $('#dataGridPage'),
        searchForm: $("#searchForm"),
        sortableColumn: false, // 列表不允许排序
        columnModel: [
            {header:'${text("主键")}',hidden: true, name:'id', index:'a.id', width:150, align:"left", frozen:true
            },
            {header:'任务id',hidden: true, name:'dcSupTaskInfo.id', width:150, align:"left"},
            {header:'牵头责任单位编号',hidden: true, name:'leaderOrgCode',  width:150, align:"left"},
            // {header:'${text("任务年度")}', name:'dcSupTaskInfo.taskYear', index:'a.task_year', width:80, align:"center"},
            {header:'${text("督办字号")}', name:'dcSupTaskInfo.messageNumber', index:'a.message_number', width:100, align:"left"},
            {header:'${text("任务标题")}', name:'dcSupTaskInfo.taskTitle', index:'a.task_title', width:150, align:"left"},
            {header:'${text("任务类型")}', name:'dcSupTaskInfo.taskTypeName', index:'a.task_type_name', width:150, align:"left"},
            {header:'任务内容', name:'dcSupTaskInfo.taskContent', width:150, align:"left", formatter: function(val, obj, row, act){
                    return '<a href="${ctx}/taskdeploy/dcSupTaskInfo/detailForm?id='+row.dcSupTaskInfo.id+'" class="btnList" data-title="${text("督办任务信息")}">'+(val||'暂无内容')+'</a>';
                }},
            {header:'牵头责任单位', name:'leaderOrgName',width:150, align:"left",hidden: true},
            {header:'负责科室/人', name:'transferOrgName',  width:100, align:"left"},
            {header:'任务状态', name:'taskStatus', width:120, align:"left", formatter: function(val, obj, row, act){return  js.getDictLabel(${@DictUtils.getDictListJson('dc_task_action_status')}, val, '${text("未知")}', true);}},
            {header:'${text("操作")}', name:'actions', width:100,align:"center", formatter: function(val, obj, row, act){
                    var actions = [];
                    actions.push('<a href="${ctx}/action/dcSupTaskAction/listOrg1?remarks1=2&taskId='+row.dcSupTaskInfo.id+'" class="btn btn-primary btn-xs btnList" title="${text("查看反馈")}" ><span>查看反馈</span></a>&nbsp;');
                    return actions.join('');
                }}
        ],
        onSelectRow: function(id, isSelect, event){

        },
        ajaxSuccess: function(data){

        }
    });
</script>